package com.ycy.io;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.net.Socket;

public class IOSender {


  public static void main(String[] args) {
    try {

      for (int i = 0; i < 10; i++) {

        Socket socket = new Socket("localhost", 8090);

        OutputStream outputStream = socket.getOutputStream();
        PrintWriter printWriter = new PrintWriter(outputStream);
        printWriter.println("hello word！！！ 殷才永 " + i);
        printWriter.flush();
        System.out.println("send ！！！");
        printWriter.close();
      }
    } catch (IOException e) {
      e.printStackTrace();
    }

  }

}
